home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Serious Software / POV-Ray 3.1 / PPC Application / POV-Ray 3 Templates < prev    next >
Encoding:
Text File  |  1998-09-25  |  51.7 KB  |  1,762 lines  |  [TEXT/R*ch]

  1. @com.POV-Ray 3 Macintosh Template file
  2. @com.Version: 3.1 Rev 1
  3. @com. **** NOTE: Look for "FIXME" string for incomplete sections ****
  4. @com.Last Modified:
  5. @com.   [esp] September 27, 1995
  6. @com.   [anr] December 28, 1995
  7. @com.   [esp] March 18, 1996
  8. @com.   [Matt Kruse] April 9, 1996 <mkruse@demian.sau.edu> a few tweaks
  9. @com.   [esp] 961021 fixed irid and additional includes
  10. @com.   [anr] Januari 29, 1997
  11. @com.   [anr] June 2, 1997 fixed #switch
  12. @com.   [esp] July 11, 1998 Updated media & interior for 3.1
  13. @com.   [esp] Aug. 29, 1998 Updated examples for 3.1 version and syntax
  14. @com.   [esp] Sep. 2, 1998 Fixed references to interior and caustics,
  15. @com.         and added new material{} and #defined keywords.
  16. @com.   [esp] Sep. 25, 1998 Many fixes courtesy Mark Donovan!
  17. @com.------------------------------------------------------------
  18. @com.
  19. @com.============================================================
  20. @mt1.Headers
  21. @com.============================================================
  22. @com.
  23. @com.------------------------------
  24. @mt2.Scene File Header
  25. // Persistence of Vision Ray Tracer Scene Description File
  26. // File: .pov
  27. // Vers: 3.1
  28. // Desc: 
  29. // Date: 
  30. // Auth: 
  31.  
  32. @com.------------------------------
  33. @mt2.Standard includes
  34. // ==== Standard POV-Ray Includes ====
  35. #include "colors.inc"    // Standard Color definitions
  36. #include "textures.inc"    // Standard Texture definitions
  37.  
  38. @com.------------------------------
  39. @mt2.Additional includes
  40. // ==== Additional Includes ====
  41. // Don't have all of the following included at once, it'll cost memory and time
  42. // to parse!
  43. #include "CHARS.INC"    // A complete library of character objects, by Ken Maeno
  44. #include "CONSTS.INC"   // Various constants and alias definitions
  45. #include "FINISH.INC"   // Some basic finishes
  46. #include "GLASS.INC"    // Glass textures
  47. #include "GOLDS.INC"    // Gold textures
  48. #include "METALS.INC"   // Metallic pigments, finishes, and textures
  49. #include "RAD_DEF.INC"  // Some common radiosity settings
  50. #include "SHAPES.INC"   // Standard objects from POV-Ray's earlier days
  51. #include "SHAPES2.INC"  // Useful, but seldom used shapes
  52. #include "SHAPESQ.INC"  // Pre-defined quartic shapes
  53. #include "SKIES.INC"    // Ready defined sky spheres
  54. #include "STARS.INC"    // Some star fields
  55. #include "STDCAM.INC"   // Standard cameras
  56. #include "STONES.INC"   // Binding include-file for STONES1 and STONES2
  57. #include "STONES1.INC"  // Great stone-textures created by Mike Miller
  58. #include "STONES2.INC"  // More, done by Dan Farmer and Paul Novak
  59. #include "WOODMAPS.INC" // Basic wooden colormaps
  60. #include "WOODS.INC"    // Great wooden textures created by Dan Farmer and Paul Novak
  61.  
  62. @com.============================================================
  63. @mt1.Statements
  64. @com.============================================================
  65. @com.
  66. @com.------------------------------
  67. @mt2.background
  68. // Set a color of the background (sky)
  69. background { color red 0.1 green 0.3 blue 0.8 }
  70. @com.------------------------------
  71. @mt2.Typical camera
  72. camera
  73. {
  74.   location  <0.0 , 2.0 ,-5.0>
  75.   look_at   <0.0 , 0.0 , 0.0>
  76. }
  77. @mt2.Camera definition
  78. // set viewer's position in the scene
  79. camera
  80. {
  81. // (camera types)
  82. //  perspective (default) | orthographic | fisheye |
  83. //  ultra_wide_angle | omnimax | panoramic | cylinder 1
  84.   location  <0.0, 1.0, -6.0> // position of camera <X Y Z>
  85.   direction 2.0*z            // which way are we looking <X Y Z> & zoom
  86. //  sky       y                // rarely used
  87.   up        y                // which way is +up <X Y Z>
  88.   right     4/3*x            // which way is +right <X Y Z> and aspect ratio
  89.   look_at   <0.0, 0.0,  0.0> // point center of view at this point <X Y Z>
  90. //  angle FLOAT                // overrides "direction" with specific angle
  91. //  normal { ripples 0.2 }     // perturb the camera lens with a pattern
  92. // (focal blur extras)
  93. //  aperture 0.2               // 0...N (bigger is narrower depth of field)
  94. //  blur_samples 4             // # of rays per pixel
  95. //  focal_point <VECTOR>       // x,y,z point that is in focus
  96. }
  97. @com.------------------------------
  98. @mt2.Ambient fog
  99. fog
  100. {
  101.   fog_type 1
  102.   distance 100
  103.   color SkyBlue
  104. }
  105. @mt2.Ground fog
  106. fog
  107. {
  108.   fog_type   2
  109.   distance   10
  110.   color      rgb 0.6 // gray
  111.   fog_offset 0.1
  112.   fog_alt    0.2
  113.   turbulence 0.8
  114. }
  115. @mt2.Fog definition
  116. //FIXME
  117. // set global atmospheric fog effect in the scene.
  118. // at the fog distance, there will be 63% visibility
  119.   fog {
  120.     fog_type 1 // 1=constant, 2=ground_fog
  121.     distance 10
  122.     color Gray
  123. // turbulence <TURBULENCE>
  124. // turb_depth TURB_DEPTH
  125. // omega OMEGA
  126. // lambda LAMBDA
  127. // octaves OCTAVES
  128. // fog_offset FOG_OFFSET
  129. // fog_alt FOG_ALT
  130.   }
  131. @com.------------------------------
  132. @mt2.Rainbow
  133. // create a rainbow arc
  134. rainbow {
  135.   angle 25 // degrees
  136.   width 4 // degrees
  137.   distance 1.0e7
  138.   direction <0,-0.5,1>
  139.   jitter 0.01
  140.   arc_angle 180 // degrees
  141.   falloff_angle 60 // degrees
  142. // up <UP>
  143.   colour_map {
  144.     [0.000  colour colour red 1.0 green 0.5 blue 1.0 filter 1.0]
  145.     [0.100  colour colour red 1.0 green 0.5 blue 1.0 filter 0.8]
  146.     [0.214  colour colour red 0.5 green 0.5 blue 1.0 filter 0.8]
  147.     [0.328  colour colour red 0.2 green 0.2 blue 1.0 filter 0.8]
  148.     [0.442  colour colour red 0.2 green 1.0 blue 1.0 filter 0.8]
  149.     [0.556  colour colour red 0.2 green 1.0 blue 0.2 filter 0.8]
  150.     [0.670  colour colour red 1.0 green 1.0 blue 0.2 filter 0.8]
  151.     [0.784  colour colour red 1.0 green 0.5 blue 0.2 filter 0.8]
  152.     [0.900  colour colour red 1.0 green 0.2 blue 0.2 filter 0.8]
  153.   }
  154. }
  155. @com.------------------------------
  156. @mt2.Sky Sphere
  157. // Create an infinite sphere around scene and allow any texture on it
  158. sky_sphere
  159. {
  160.   pigment
  161.   {
  162.     gradient y
  163.     color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] }
  164.   }
  165. }
  166. @com.------------------------------
  167. @mt2.adc
  168. global_settings { adc_bailout 20 }
  169. @com.------------------------------
  170. @mt2.assumed gamma
  171. global_settings { assumed_gamma 1.0 }
  172. @com.------------------------------
  173. @mt2.HFGray16
  174. global_settings { hf_gray_16 }
  175. @com.------------------------------
  176. @mt2.irid_wavelength
  177. global_settings { irid_wavelength <0.25, 0.18, 14> }
  178. @com.------------------------------
  179. @mt2.max_trace_level
  180. global_settings { max_trace_level 20 }
  181. @com.------------------------------
  182. @mt2.max_intersections
  183. global_settings { max_intersections 200 }
  184. @com.------------------------------
  185. @mt2.number_of_waves
  186. global_settings { number_of_waves 10 }
  187. @com.------------------------------
  188. @mt2.ambient light
  189. // set an overall brightness/ambient light level in the scene
  190. global_settings { ambient_light { color <COLOR> } }
  191. @com.------------------------------
  192. @mt2.max_intersections
  193. // set the maximum ray tracing intersection depth (1...200) [64]
  194. #max_intersections 64
  195. @com.------------------------------
  196. @mt2.max_trace_level
  197. // set the maximum ray tracing bounce depth (1...20) [5]
  198. #max_trace_level 5
  199. @com.------------------------------
  200. @mt2.version
  201. // Set the language version of POV-Ray.  Enables or
  202. // disables syntax features that are version-dependent.
  203. // e.g. #version 1.0, or #version 2.0, etc.  Default is
  204. // the current version of POV-Ray.
  205. // (Note: This can toggle versions anywhere in the source)
  206. #version 3.1  // use POV-Ray 3.1 syntax
  207. @com.
  208. @com.============================================================
  209. @mt1.Animation
  210. @com.============================================================
  211. @com.
  212. @com.------------------------------
  213. @mt2.clock
  214.   // spin the torus around the X axis, as "clock" goes from 0 to 1
  215.   // the torus will rotate one complete 360 degree revolution.
  216.   // Note that the texture is put on BEFORE we rotate so it rotates too.
  217.   torus { 1,0.2 pigment {color red 1} rotate clock*x*360}
  218. @com.
  219. @com.============================================================
  220. @mt1.Expressions
  221. @com.============================================================
  222. @com.
  223. @com.------------------------------
  224. @mt2.Built-in Ids
  225. // These identifiers are built in to POV-Ray, ready to use
  226. //  #declare pi = 3.1415926535897932384626
  227. //  #declare true = 1
  228. //  #declare yes = 1
  229. //  #declare on = 1
  230. //  #declare false = 0
  231. //  #declare no = 0
  232. //  #declare off = 0
  233. //  #declare u = <1,0>
  234. //  #declare v = <0,1>
  235. //  #declare x = <1,0,0>
  236. //  #declare y = <0,1,0>
  237. //  #declare z = <0,0,1>
  238. //  #declare t = <0,0,0,1>
  239. @com.------------------------------
  240. @mt2.Math Operators
  241. //   ( ) * / + - !
  242. #declare MyResult = -2*B + (A*A - 4)
  243. @mt2.Relational Operators
  244. // Relationals must be within parentheses
  245. // Return arithmetic value 0 for false or 1 for true
  246. //   <  <=  =  !=  >=  >
  247. #declare BallColor = pigment { red (clock > 0.5) } // black or red
  248. @com.------------------------------
  249. @mt2.Vector components
  250. // extract each component of a vector:
  251. // #if (MyVector.x > 5) ...
  252. // #if (MyVector.y > 5) ...
  253. // #if (MyVector.z > 5) ...
  254. // #if (MyVector.t > 5) ...
  255. @com.------------------------------
  256. @mt2.Strings
  257. /* various string operations
  258. asc(S1) // Convert 1st character of S1 to ASCII value
  259. chr(A) // Convert extended ASCII value A to a 1 character string
  260. concat(S1,S2) // combine S1 and S2 into one long string
  261. file_exists(S1) // Search current and include directories for existence of file S1 (0 or 1)
  262. str(A,L,P) // Convert float A to string, at least L characters long,
  263.            // with P digits after the decimal point (if P is -1, make max)
  264. strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1
  265. strlen(S1) // Returns # of characters in string S1
  266. strlwr(S1) // Lower case of S1
  267. substr(S1,P,L) // Sub-string from S1, start at position P for length L
  268. strupr(S1) // Upper case of S1
  269. val(S1) // Convert string S1 to float
  270. // some special control characters that can be used within strings
  271.   "\a" Bell or alarm, 0x07
  272.   "\b" Backspace, 0x08
  273.   "\f" Form feed, 0x0C
  274.   "\n" New line (line feed) 0x0A
  275.   "\r" Carriage return 0x0D
  276.   "\t" Horizontal tab 0x09
  277.   "\v" Vertical tab 0x0B
  278.   "\0" Null 0x00
  279.   "\\" Backslash 0x5C
  280.   "\'" Single quote 0x27
  281. */
  282. @com.
  283. @com.============================================================
  284. @mt1.Light sources
  285. @com.============================================================
  286. @com.
  287. @com.------------------------------
  288. @mt2.Point light
  289. // create a regular point light source
  290. light_source
  291. {
  292.   0*x // light's position (translated below)
  293.   color red 1.0  green 1.0  blue 1.0  // light's color
  294.   translate <-20, 40, -20>
  295. }
  296. @com.------------------------------
  297. @mt2.Spotlight
  298. // create a point "spotlight" (conical directed) light source
  299. light_source
  300. {
  301.   0*x                     // light's position (translated below)
  302.   color rgb <1,1,1>       // light's color
  303.   spotlight               // this kind of light source
  304.   translate <40, 80, -40> // <x y z> position of light
  305.   point_at <0, 0, 0>      // direction of spotlight
  306.   radius 5                // hotspot (inner, in degrees)
  307.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  308.   falloff 8               // intensity falloff radius (outer, in degrees)
  309. }
  310. @com.------------------------------
  311. @mt2.Cylindrical light
  312. // create a point "spotlight" (cylindrical directed) light source
  313. light_source
  314. {
  315.   0*x                     // light's position (translated below)
  316.   color rgb <1,1,1>       // light's color
  317.   spotlight               // this kind of light source
  318.   cylinder                // this variation
  319.   translate <40, 80, -40> // <x y z> position of light
  320.   point_at <0, 0, 0>      // direction of spotlight
  321.   radius 5                // hotspot (inner, in degrees)
  322.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  323.   falloff 8               // intensity falloff radius (outer, in degrees)
  324. }
  325. @com.------------------------------
  326. @mt2.looks_like
  327. // light_source { ...
  328.   // put this inside a light_source to give it a visible appearance
  329.   looks_like { sphere { 0*x, 5 pigment { Yellow } } }
  330. @com.------------------------------
  331. @mt2.area light
  332. // An area light (creates soft shadows)
  333. // WARNING: This special light can significantly slow down rendering times!
  334. light_source
  335. {
  336.   0*x // light's position (translated below)
  337.   color rgb 1.0  // light's color
  338.   // <widthVector> <heightVector> nLightsWide mLightsHigh
  339.   area_light
  340.   <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  341.   4, 4                // total number of lights in grid (4x*4z = 16 lights)
  342.   adaptive 0          // 0,1,2,3... 
  343.   jitter              // adds random softening of light
  344.   translate <40, 80, -40>   // <x y z> position of light
  345. }
  346. @com.------------------------------
  347. @mt2.Area spotlight
  348. // create an "area spotlight" (conically directed) light source
  349. light_source {
  350.   <40, 80, -40>           // light's position
  351.   color rgb <1,1,1>       // light's color
  352.   spotlight               // this kind of light source
  353.   point_at <0, 0, 0>      // direction of spotlight
  354.   radius 5                // hotspot (inner, in degrees)
  355.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  356.   falloff 8               // intensity falloff radius (outer, in degrees)
  357.   // <widthVector> <heightVector> nLightsWide mLightsHigh
  358.   area_light
  359.   <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  360.   4, 4                // total number of lights in grid (4x*4z = 16 lights)
  361.   adaptive 1          // 0,1,2,3...
  362.   jitter              // adds random softening of light
  363. }
  364. @com.------------------------------
  365. @mt2.light definition
  366. /*
  367. light_source
  368. {
  369.     <CENTER>
  370.     color <COLOUR>
  371.     [ spotlight ]
  372.     [ cylinder ]
  373.     [ point_at <POINT> ]
  374.     [ radius RADIUS ]
  375.     [ falloff FALLOFF ]
  376.     [ tightness TIGHTNESS ]
  377.     [ area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 ]
  378.     [ adaptive ADAPTIVE ]
  379.     [ jitter JITTER ]
  380.     [ looks_like { OBJECT } ]
  381.     [ fade_distance FADE_DISTANCE ]
  382.     [ fade_power FADE_POWER (1...2) ]
  383.     [ atmospheric_attenuation BOOL ]
  384.     [ shadowless ]
  385. }
  386. */
  387. @com.
  388. @com.============================================================
  389. @mt1.Misc. Directives
  390. @com.============================================================
  391. @com.
  392. @com.------------------------------
  393. @mt2.declare
  394. #declare MyColor = color red 0.7 green 0.5 blue 0.3
  395. @com.------------------------------
  396. @mt2.default
  397. // sets the default texture that objects get when they have no texture specified
  398. #default
  399. {
  400.   texture { pigment {color red 1} finish{ambient 0.2} }
  401. }
  402. @com.------------------------------
  403. @mt2.defined
  404. // Check if a user indentifier has been defined yet (via #declare)
  405. #if (!defined(BigBox_Shape))
  406.   #declare BigBox_Shape = box{-10,+10}
  407. #end
  408. // set up and check flags
  409. #if (!defined(MY_TEXTURE_INC_FILE))
  410.   #include "MyTexture.inc"
  411. #end
  412. @com.------------------------------
  413. @mt2.if
  414. #if (expr)
  415.   // true stuff happens here
  416. #else
  417.   // false stuff happens here
  418. #end
  419. @com.------------------------------
  420. @mt2.if example
  421.   #if (High_Quality)
  422.     // This section is parsed if High_Quality is true
  423.   #end // End of conditional part
  424. // or you can use the else clause too
  425.   #if (clock > 2)
  426.     // This section is parsed if clock is > 2
  427.   #else
  428.     // This section is parsed if clock is <= 2
  429.   #end // End of conditional part
  430. @com.------------------------------
  431. @mt2.ifdef
  432. #ifdef (ident)
  433.   // true stuff happens here
  434. #else
  435.   // false stuff happens here
  436. #end
  437. @com.------------------------------
  438. @mt2.ifdef example
  439.   #ifdef (SphereFlake_Shape)
  440.     // This section is  parsed if SphereFlake_Shape is declared
  441.   #else
  442.     // This section is  parsed if SphereFlake_Shape is NOT declared
  443.     #declare SphereFlake_Shape = sphere {0,1} // make a default shape
  444.   #end // End of conditional part
  445. @com.------------------------------
  446. @mt2.switch
  447. #switch (expr)
  448.   #case (expr)
  449.   #break
  450.   #range (expr,expr)
  451.   #break
  452.   #else
  453. #end
  454. @com.------------------------------
  455. @mt2.switch example
  456. // Let's make some constant names
  457. #declare CS_Easy   = 1
  458. #declare CS_Medium = 3
  459. #declare CS_Hard   = 5
  460.  
  461. // Let the user choose the method to use
  462. #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
  463.  
  464. // Do something dependent on the user's choice
  465. #switch (Complexity_Switch)
  466.   #case (CS_Easy)
  467.   // This statement is done if (Complexity_Switch = CS_Easy)
  468.   #declare MyShape = box{-1,+1}
  469.   #break // end of CS_Easy
  470.   #range (CS_Medium, CS_Hard)
  471.   // This statement is done if Complexity_Switch is CS_Medium
  472.   // or CS_Hard or anything in between
  473.   #declare MyShape = torus{1, 0.5}
  474.   #break // end of CS_Hard
  475.   #else
  476.   // This statement is done if none of the above match
  477.   #declare MyShape = sphere{0,1}
  478. #end
  479. @com.------------------------------
  480. @mt2.while
  481. // Create 10 balls along X axis, from 0 to 9
  482. #declare BallCount = 0
  483. #while (BallCount < 10)
  484.   sphere
  485.   {
  486.     <BallCount,0,0>,  // NOTE: <0,0,0>, <1,0,0>, <2,0,0>, etc.
  487.     0.5
  488.   }
  489.   #declare BallCount = BallCount+1 // increment our counter
  490. #end
  491. @com.------------------------------
  492. @mt2.Messages
  493.   #debug      "During scene parsing, general info message"
  494.   #fatal      "During scene parsing, display and force POV-Ray to stop"
  495.   #render     "After scene parsing, about to render"
  496.   #statistics "After scene frame is rendered"
  497.   #warning    "During scene parsing"
  498. #end
  499. @com.------------------------------
  500. @mt2.version
  501. #declare Temp_Vers = version    // Save original value of #version
  502. #version 2.0                    // Change to 1.0 mode
  503. // Version 2.0 stuff goes here ...
  504. #version Temp_Vers              // Restore original #version value
  505. @com.
  506. @com.============================================================
  507. @mt1.Shapes
  508. @com.============================================================
  509. @com.
  510. @com.------------------------------
  511. @mt2.bicubic_patch
  512. // 3D curved FINITE (no CSG) surface created from a mesh of triangles
  513. bicubic_patch
  514. {
  515.   type 1 // patch_type (0..1)
  516.   // 0 = Bezier patch, just store the triangular vertices
  517.   // 1 = Bezier patch, store all plane equations defined by
  518.   //       the triangulation of the patch into sub patches
  519.   //       (faster, uses more memory)
  520.    flatness 0.1 // flatness value
  521.   //       flatness_value = 0.0 to 1.0, with higher values
  522.   //        giving flatter, less smooth results
  523.   u_steps 3 // # of triangles to subdivide (1-5)
  524.   v_steps 3 // # of triangles to subdivide (1-5)
  525.   <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2>
  526.   <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1,  0>
  527.   <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2,  0>
  528.   <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2>
  529. }
  530. @com.------------------------------
  531. @mt2.box
  532. // create a box that extends between the 2 specified points
  533. box
  534. {
  535.   <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  536.   < 1,  1,  1>  // other corner position <X2 Y2 Z2>
  537. }
  538. @com.------------------------------
  539. @mt2.blob
  540. // create a smooth blobby shape
  541. #declare StrengthVal = 1.0 // (+ or -) strength of component's radiating density
  542. #declare RadiusVal   = 1.0 // (0 < RadiusVal) outer sphere of influence on other components
  543. blob
  544. {
  545.   // threshold (0.0 < threshold <= StrengthVal) surface falloff threshold #
  546.   threshold 0.6
  547.   sphere { < 0.75,   0,    0>, StrengthVal, RadiusVal }
  548.   sphere { <-0.375,  0.65, 0>, StrengthVal, RadiusVal }
  549.   sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal }
  550.   cylinder { -z, +z, 0.1, StrengthVal, RadiusVal }
  551.   // [sturm]
  552.   scale 2
  553. }
  554. @com.------------------------------
  555. @mt2.cone
  556. // clipped conical shape
  557. // cone { <END1>, RADIUS1, <END2>, RADIUS2 [open] }
  558. // Where <END1> and <END2> are vectors defining the x,y,z
  559. // coordinates of the center of each end of the cone
  560. // and RADIUS1 and RADIUS2 are float values for the radii
  561. // of those ends.  open, if present, cone is hollow, else capped
  562. cone
  563. {
  564.   1*y,  0.0,
  565.   -1*y, 1.0
  566.   // open
  567. }
  568. @com.------------------------------
  569. @mt2.cubic
  570. // create a 3rd order infinite polynomial surface
  571. cubic
  572. {
  573.   <
  574. // x^3,      x^2y,     x^2z,     x^2,
  575.    0,        0,        0,        0,
  576. // xy^2,     xyz,      xy,       xz^2,
  577.    0,        0,        0,        0,
  578. // xz,       x,        y^3,      y^2z,
  579.    0,        0,        0,        0,
  580. // y^2,      yz^2,     yz,       y,
  581.    0,        0,        0,        0,
  582. // z^3,      z^2,      z,        C
  583.    0,        0,        0,        0
  584.   >
  585.   sturm // optional, slower but reduces speckles
  586. }
  587.  
  588. @mt2.cylinder
  589. // Capped Cylinder, closed [or open ended]
  590. // cylinder { <END1>, <END2>, RADIUS [open] }
  591. //  END1 = coord of one end of cylinder
  592. //  END2 = coord of other end
  593. // RADIUS = size of cylinder
  594. // open = if present, cylinder is hollow, else capped
  595. cylinder
  596. {
  597.   0*x,  3*x,  1
  598.   // open
  599. }
  600. @com.------------------------------
  601. @mt2.disc
  602. // flat circular FINITE (no CSG) shape, center hole cutout is optional
  603. disc
  604. {
  605.   <0, 1, 0>  // center position
  606.   z,         // normal vector
  607.   1.0,       // outer radius
  608.   0.2        // optional hole radius
  609. }
  610. @com.------------------------------
  611. @mt2.fractal
  612. // create a 3-D slice of a 4-D julia fractal object
  613. julia_fractal
  614.   <-0.083,0.0,-0.83,-0.025> 
  615.   quaternion // hypercomplex?
  616.   cube // TYPE: sqr cube 
  617.   max_iteration 8 
  618.   precision 20 // 10...500? FIXME
  619.   //  slice xx?
  620.  }
  621. @com.------------------------------
  622. @mt2.height_field
  623. // uses image color index as height, extends along X-Z axes
  624. // from <0 0 0> to <1 1 1>
  625. height_field
  626. {
  627.   gif               // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
  628.   "plasma3.gif"     // the file name to read
  629. //  inverse | texture {...}
  630. //  [smooth]        // make smoother surface
  631. //  [water_level N] // truncate/clip below N (0.0 ... 1.0)
  632. // translate VECTOR | rotate VECTOR | scale VECTOR
  633. }
  634. @com.------------------------------
  635. @mt2.height_field+imagemap
  636. // uses image color index as height, extends along X-Z axes
  637. // from <0 0 0> to <1 1 1>
  638. height_field
  639. {
  640.   gif "plasma3.gif"
  641.   texture
  642.   {
  643.     pigment
  644.     {
  645.       image_map { gif "plasma3.gif" map_type 0 interpolate 2 once }
  646.       rotate x*90 // lay X-Y image map down onto X-Z height field plane
  647.     }
  648.   }
  649. }
  650. @com.------------------------------
  651. @mt2.lathe
  652. // rotate a 2-D outline of points around the Y axis to create a 3-D shape
  653. lathe {
  654.   linear_spline // linear_spline | quadratic_spline | cubic_spline
  655.   5, // number of points
  656.   <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of <u,v> points
  657. }
  658. @com.------------------------------
  659. @mt2.mesh
  660. // triangle or smooth-triangle mesh FINITE (no CSG) shape
  661. // NOTE: Each triangle can be independently textured,
  662. //       remaining triangles get texture at bottom
  663. mesh // box example here
  664. {
  665.   /* top side */
  666.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } }
  667.   triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } }
  668.   /* bottom side */
  669.   triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> }
  670.   triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> }
  671.   /* left side */
  672.   triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> }
  673.   triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> }
  674.   /* right side */
  675.   triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } }
  676.   triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } }
  677.   /* front side */
  678.   triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } }
  679.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } }
  680.   /* back side */
  681.   triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> }
  682.   triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> }
  683.   texture
  684.   { // remaining triangles get this texture
  685.     pigment { color rgb<0.9, 0.9, 0.9> }
  686.     finish { ambient 0.2 diffuse 0.7 }
  687.   }
  688. }
  689. @com.------------------------------
  690. @mt2.object
  691. // general purpose enclosing wrapper for a predefined shape
  692. #define MyShape = box {-1,1}     // define the shape
  693. object { MyShape }               // create an actual object with that shape
  694. object { MyShape translate 3*x}  // create another object with that shape
  695. @com.------------------------------
  696. @mt2.plane
  697. // An infinite planar surface
  698. // plane {<A, B, C>, D } where: A*x + B*y + C*z = D
  699. plane
  700. {
  701.   y, // <X Y Z> unit surface normal, vector points "away from surface"
  702.   -1.0 // distance from the origin in the direction of the surface normal
  703.   hollow on // has an inside pigment?
  704. }
  705. @com.------------------------------
  706. @mt2.polygon
  707. // arbitrary X,Y FINITE (no CSG) shape
  708. // A complex example for a polygon is the letter "P":
  709. polygon
  710. {
  711.   12, // number of points
  712.   <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of <u,v> points
  713.   <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4>
  714. }
  715. @com.------------------------------
  716. @mt2.polynomial
  717. // create an Nth order infinite polynomial surface
  718. // poly { N <a,b,c...> [sturm] }
  719. // N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6
  720. poly
  721. {
  722.   5, // order of polynomial (2...7)
  723.   <
  724. // x^5,        x^4y,       x^4z,       x^4,
  725.    0,          0,          0,          0,
  726. // x^3y^2,     x^3yz,      x^3y,       x^3z^2,
  727.    0,          0,          0,          0,
  728. // x^3z,       x^3,        x^2y^3,     x^2y^2z,
  729.    0,          0,          0,          0,
  730. // x^2y^2,     x^2yz^2,    x^2yz,      x^2y,
  731.    0,          0,          0,          0,
  732. // x^2z^3,     x^2z^2,     x^2z,       x^2,
  733.    0,          0,          0,          0,
  734. // xy^4,       xy^3z,      xy^3,       xy^2z^2,
  735.    0,          0,          0,          0,
  736. // xy^2z,      xy^2,       xyz^3,      xyz^2,
  737.    0,          0,          0,          0,
  738. // xyz,        xy,         xz^4,       xz^3,
  739.    0,          0,          0,          0,
  740. // xz^2,       xz,         x,          y^5,
  741.    0,          0,          0,          0,
  742. // y^4z,       y^4,        y^3z^2,     y^3z,
  743.    0,          0,          0,          0,
  744. // y^3,        y^2z^3,     y^2z^2,     y^2z,
  745.    0,          0,          0,          0,
  746. // y^2,        yz^4,       yz^3,       yz^2,
  747.    0,          0,          0,          0,
  748. // yz,         y,          z^5,        z^4,
  749.    0,          0,          0,          0,
  750. // z^3,        z^2,        z,          C           
  751.    0,          0,          0,          0
  752.   >
  753.   sturm // optional, slower but reduces speckles
  754. }
  755. @com.------------------------------
  756. @mt2.prism
  757. // extrude a closed 2-D shape along an axis
  758. prism {
  759.   linear_sweep // or conic_sweep for tapering to a point
  760.   cubic_spline // linear_spline | quadratic_spline | cubic_spline
  761.   -0.5,        // height 1
  762.    0.5,        // height 2
  763.   10,          // number of points
  764.   // the <u,v> points
  765.   < 0.2, -1.0>, < 0.2,  0.2>, < 1.0, -0.2>, < 1.0,  0.2>, < 0.2,  1.0>, 
  766.   <-0.2,  1.0>, <-1.0,  0.2>, <-1.0, -0.2>, <-0.2,  0.2>, <-0.2, -1.0>
  767.   // [open]
  768.   // [sturm]
  769. }
  770. @com.------------------------------
  771. @mt2.quadric
  772. // create a quadratic (2nd order) infinite polynomial surface
  773. quadric
  774. {
  775.   <0, 1, 1> //  A x^2  + B y^2  + C z^2  +
  776.   <1, 0, 0> //  D xy   + E xz   + F yz   +
  777.   <0, 3, 0> //  G x    + H y    + I z    +
  778.   2         //  J
  779.   sturm // optional, slower but reduces speckles
  780. }
  781. @com.------------------------------
  782. @mt2.quartic
  783. // create a 4th order infinite polynomial surface
  784. quartic
  785.  {
  786. <
  787. // x^4,        x^3y,       x^3z,       x^3,        x^2y^2,
  788.    0,          0,          0,          0,          0,
  789. // x^2yz,      x^2y,       x^2z^2,     x^2z,       x^2,
  790.    0,          0,          0,          0,          0,
  791. // xy^3,       xy^2z,      xy^2,       xyz^2,      xyz,
  792.    0,          0,          0,          0,          0,
  793. // xy,         xz^3,       xz^2,       xz,         x,
  794.    0,          0,          0,          0,          0,
  795. // y^4,        y^3z,       y^3,        y^2z^2,     y^2z,
  796.    0,          0,          0,          0,          0,
  797. // y^2,        yz^3,       yz^2,       yz,         y,
  798.    0,          0,          0,          0,          0,
  799. // z^4,        z^3,        z^2,        z,          C           
  800.    0,          0,          0,          0,          0
  801. >
  802.   sturm // optional, slower but reduces speckles
  803. }
  804. @com.------------------------------
  805. @mt2.smooth_triangle
  806. // rounded-surface FINITE (no CSG) triangle shape
  807. smooth_triangle
  808. {
  809.   <  0,  30, 0> <0,  0.7071, -0.7071>  // <Vertex1>  <SurfaceNormal1>
  810.   < 40, -20, 0> <0, -0.8664, -0.5>     // <Vertex2>  <SurfaceNormal2>
  811.   <  0,   0, 0> <0, -0.5,    -0.8664>  // <Vertex3>  <SurfaceNormal3>
  812. }
  813. @com.------------------------------
  814. @mt2.sphere
  815. // create a sphere shape
  816. sphere
  817. {
  818.   <0, 1, 0> // center of sphere <X Y Z>
  819.   0.5       // radius of sphere
  820.   // scale <1,2,1> // <= Note: Spheres can become ellipses by uneven scaling
  821. }
  822. @com.------------------------------
  823. @mt2.superellispoid
  824. // create a superquadric ellipsoid shape
  825. // As the exponents approach 1.0, the edges get rounder
  826. superellipsoid
  827. {
  828.   0.5,  // east-west exponent (0.0 ... 1.0)
  829.   1.0,  // north-south exponent (0.0 ... 1.0)
  830. }
  831. @com.------------------------------
  832. @mt2.Surface of Revolution
  833. // create a Surface of Revolution shape (like lathe, but faster)
  834. surface_of_revolution
  835. {
  836.     7, // # of points
  837.     <0.000000, 0.000000> // list of <u,v> points
  838.     <0.118143, 0.000000>
  839.     <0.620253, 0.540084>
  840.     <0.210970, 0.827004>
  841.     <0.194093, 0.962025>
  842.     <0.286920, 1.000000>
  843.     <0.468354, 1.033755>
  844.     // [open]
  845. }
  846. @com.------------------------------
  847. @mt2.text
  848. // create a TrueType text shape
  849. text
  850. {
  851.   ttf             // font type (only TrueType format for now)
  852.   "crystal.ttf",  // Microsoft Windows-format TrueType font file name
  853.   "POV-Ray",      // the string to create
  854.   2,              // the extrusion depth
  855.   0               // inter-character spacing
  856. }
  857. @com.------------------------------
  858. @mt2.torus
  859. // torus {MAJOR, MINOR} // (in the X-Z plane)
  860. // MAJOR = float value giving the major radius
  861. // MINOR = float specifying the minor radius
  862. // The major radius extends from the center of the hole
  863. // to the mid-line of the rim while the minor radius
  864. // is the radius of the cross-section of the rim.
  865. torus
  866. {
  867.   0.8,
  868.   0.2
  869. }
  870. @com.------------------------------
  871. @mt2.triangle
  872. // triangular FINITE (no CSG) shape (vertices are endpoints)
  873. triangle
  874. {
  875.   <-1,  0, -1>  // <Vertex1>
  876.   < 1,  0, -1>  // <Vertex2>
  877.   < 0,  0,  1>  // <Vertex3>
  878. }
  879. @com.
  880. @com.============================================================
  881. @mt1.Shape modifiers
  882. @com.============================================================
  883. @com.
  884. @com.------------------------------
  885. @mt2.bounded_by
  886. // set an outer proposed boundary for parent object(s)
  887. // allows the ray-tracer to do a quick check on the Bounding Shape,
  888. // and if outside, it skips checking this object, which can speed
  889. // up overall rendering of complex shapes.  Note that this
  890. // is not a 100% guaranteed clipping shape... use the
  891. // clipped_by statement for that.
  892. bounded_by { box { -(x+y+z) +(x+y+z) }
  893. @com.------------------------------
  894. @mt2.clipped_by
  895. // set clipping shape for parent object.
  896. // (parent shape will not extend beyond ClipShape bounds)
  897. clipped_by { sphere { 0*x, 1.0 } }
  898. @com.------------------------------
  899. @mt2.hollow
  900. // allow atmosphere inside shape
  901.   hollow
  902. @com.------------------------------
  903. @mt2.interior
  904.   // describes inside of a shape (similar to texture, but for inside, not surface)
  905.   interior {
  906.     ior N
  907.     caustics N
  908.     fade_power N
  909.     fade_distance D
  910.     media {..media items..}
  911.   }
  912. @com.------------------------------
  913. @mt2.material
  914. // Optional wrapper to hold texture and interior items in a single identifier
  915. //  MATERIAL:
  916. //    material{[MATERIAL_IDENTIFIER][MATERIAL_ITEMS...]}
  917. //  MATERIAL_ITEMS:
  918. //    TEXTURE  |  INTERIOR
  919.   #declare MyGlass = material{ texture{Glass_T} interior{Glass_I} }
  920.   object{ MyObject material{MyGlass} }
  921.  
  922. @com.------------------------------
  923. @mt2.media
  924. media
  925. {
  926.   intervals Number   |   samples Min, Max |
  927.   confidence Value   |   variance Value   |  ratio Value  |
  928.   absorption  COLOR  |   emission COLOR   |
  929.   scattering { Type, COLOR  [ eccentricity Value ] [ extinction Value ] }
  930.   density { [DENSITY_IDENTIFIER] [PATTERN_TYPE] [DENSITY_MODIFIER...] }
  931. }
  932. @com.------------------------------
  933. @mt2.no_shadow
  934. // give object no shadow
  935.   no_shadow
  936. @com.------------------------------
  937. @mt2.open
  938. // some objects (cylinder, cone, prism, etc.) can have their ends open
  939.   open
  940. @com.
  941. @com.============================================================
  942. @mt1.CSG operations
  943. @com.============================================================
  944. @com.
  945. @com.------------------------------
  946. @mt2.difference
  947. // CSG difference, subtract intersections of shapes 2...N from Shape1
  948. difference
  949. {
  950.   Shape1 {...} // Start with this shape
  951.   Shape2 {...} // This will be "cut out" of Shape1
  952.   ShapeN {...} // This will be "cut out" of Shape1
  953. }
  954. @com.------------------------------
  955. @mt2.intersection
  956. // CSG intersection, the common space where all the shapes meet
  957. intersection
  958. {
  959.   Shape1 {...}
  960.   Shape2 {...}
  961.   ShapeN {...}
  962. }
  963. @com.------------------------------
  964. @mt2.inverse
  965. // flip an object's inside and outside for intersect/difference
  966. intersection
  967. {
  968.   Shape1 {...}
  969.   Shape2 {... inverse }
  970. }
  971. @com.------------------------------
  972. @mt2.merge
  973. // CSG merge, merge all of shapes 1...N
  974. // like “union”, but melted together so no overlap seam lines inside
  975. merge
  976. {
  977.   Shape1 {...}
  978.   Shape2 {...}
  979.   ShapeN {...}
  980. }
  981. @com.------------------------------
  982. @mt2.union
  983. // CSG union, add all of shapes 1...N
  984. union
  985. {
  986.   Shape1 {...}
  987.   Shape2 {...}
  988.   ShapeN {...}
  989. }
  990. @com.
  991. @com.============================================================
  992. @mt1.Transformations
  993. @com.============================================================
  994. @com.
  995. @mt2.matrix
  996. // Matrix is an object transformation that does rotation about the Y axis,
  997. // shear along the Y axis, and translation along the Y axis
  998. matrix
  999. <
  1000.   0.886, 0.5, 0.5,
  1001.   0,     1,   0,
  1002.   0.5,   0,  -0.886,
  1003.   0,     1.5, 0
  1004. >
  1005. @com.------------------------------
  1006. @mt2.rotate
  1007. // rotate shape or texture around <0 0 0>, relative to current orientation
  1008. // example: rotate 30*x
  1009. rotate <45, 45, 0> // <dX  dY  dZ> (in degrees)
  1010. @com.------------------------------
  1011. @mt2.scale
  1012. // "resize" an object or texture relative to its current size
  1013. // example: scale 2.0
  1014. scale <1.0,  2.0,  1.0> // <dX dY dZ>
  1015. @com.------------------------------
  1016. @mt2.translate
  1017. // Move object or texture relative to current position
  1018. // example: translate -5.0*z
  1019. translate <2.0, 4.0, -1.0>  // <dX dY dZ>
  1020. @com.------------------------------
  1021. @mt2.Transform
  1022. // object/texture transformation
  1023. // do a predeclared translate/rotate/scale combo
  1024. // e.g.:
  1025. #declare Leaf_Orientation = transform { scale 4.0 rotate 30*z translate 2*y }
  1026. transform Leaf_Orientation // transform an object
  1027. @com.
  1028. @com.============================================================
  1029. @mt1.Textures A-M
  1030. @com.============================================================
  1031. @com.
  1032. @com.------------------------------
  1033. @mt2.Texture Definition
  1034. /*
  1035. texture
  1036. {
  1037.   TEXTURE_IDENTIFIER
  1038.   pigment {
  1039.     PIGMENT_IDENTIFIER
  1040.     PATTERN_TYPE
  1041.     PIGMENT_MODIFIERS
  1042.     TRANSFORMATIONS...
  1043.   }
  1044.   normal {
  1045.     NORMAL_IDENTIFIER
  1046.     NORMAL_PATTERN_TYPE
  1047.     NORMAL_MODIFIERS
  1048.     TRANSFORMATIONS...
  1049.   }
  1050.   finish {
  1051.     FINISH_IDENTIFIER
  1052.     [ ambient AMBIENT | <AMBIENT> ]
  1053.     [ diffuse DIFFUSE ]
  1054.     [ brilliance BRILLIANCE ]
  1055.     [ phong PHONG ]
  1056.     [ phong_size PHONG_SIZE ]
  1057.     [ specular SPECULAR ]
  1058.     [ roughness ROUGHNESS ]
  1059.     [ metallic [ METALLIC ] ]
  1060.     [ reflection REFLECTION | <REFLECTION> ]
  1061.     [ irid { thickness THICKNESS turbulence TURBULENCE } ]
  1062.   }
  1063.   interior {
  1064.     [ ior IOR ]
  1065.     [ caustics CAUSTICS ]
  1066.     [ fade_distance FADE_DISTANCE ]
  1067.     [ fade_power FADE_POWER ]
  1068.   }
  1069.   TRANSFORMATIONS
  1070. }
  1071. */
  1072. @com.------------------------------
  1073. @mt2.texture example
  1074. texture
  1075. {
  1076.   pigment
  1077.   {
  1078.     marble // some pattern
  1079.     color_map {[0.1 color red 1] [0.5 color rgbf 1]}
  1080.     turbulence 0.5
  1081.     scale <1,3,1>// transformations
  1082.   }
  1083.   // same pattern for normal and pigment adds weathered bumps
  1084.   normal
  1085.   {
  1086.     marble // some pattern
  1087.     turbulence 0.5
  1088.     scale <1,3,1>// transformations
  1089.   }
  1090.   finish
  1091.   {
  1092.     ambient 0.2
  1093.     specular 0.6 // shiny
  1094.   }
  1095. }
  1096. @com.------------------------------
  1097. @mt2.agate pattern
  1098. // texture pigment/normal pattern
  1099.   agate // use an agate-like texture
  1100.   agate_turb 0.3 // can alter turbulence [1.0]
  1101.   // color_map {...} // optional color map
  1102. @com.------------------------------
  1103. @mt2.ambient finish
  1104. // texture finish attribute
  1105. ambient 0.2 // set ambient surface reflection (0...1) [0.1]
  1106. @com.------------------------------
  1107. @mt2.attenuation finish
  1108. // texture finish attribute
  1109.    fade_distance 50
  1110.    fade_power 1 // 1 or 2
  1111. @com.------------------------------
  1112. @mt2.bozo pattern
  1113. // texture pigment/normal pattern
  1114. bozo // use color map to swirl colors
  1115. // turbulence 0.3
  1116. // color_map...
  1117. @com.------------------------------
  1118. @mt2.brick pattern
  1119. // texture pigment/normal pattern
  1120.   pigment
  1121.   {
  1122.     brick      color Red, color Gray
  1123.     brick_size <2,1,1>   // size of brick
  1124.     mortar     0.2       // width of mortar
  1125.   }
  1126. @com.------------------------------
  1127. @mt2.brilliance finish
  1128. // texture finish attribute
  1129.   brilliance 0.5 // tightness of diffuse illumination
  1130. @com.------------------------------
  1131. @mt2.bumps pattern
  1132. // texture pigment/normal pattern
  1133.   bumps 0.3 // bumpy surface (0...1)
  1134. @com.------------------------------
  1135. @mt2.caustics interior
  1136. // interior attribute
  1137.    interior { ior 1.1 caustics 1.0 }
  1138. @com.------------------------------
  1139. @mt2.checker
  1140. // texture pigment/normal pattern
  1141. // cube checker pattern, alternates color1 and color2
  1142.   checker
  1143.     color red 1 green 1 blue 1
  1144.     color red 0 green 1 blue 0
  1145. @com.------------------------------
  1146. @mt2.color
  1147. // texture pigment attribute
  1148. // RGB values can range from 0.0 (dark) to 1.0 (saturated)
  1149.   color red 0.5 green 0.5 blue 0.5 // filter 0.8
  1150. @com.------------------------------
  1151. @mt2.color_map
  1152. // texture pigment {} attribute
  1153. // create a smooth color gradation map
  1154. color_map
  1155. {
  1156.   //  [ END_VAL color red R green G blue B filter F transmit T]
  1157.   [  0.1  color red 0.0 green 0.0 blue 0.0]
  1158.   [  0.3  color red 0.8 green 0.4 blue 0.2]
  1159.   [  0.5  color red 0.0 green 0.0 blue 0.0]
  1160.   [  0.7  color red 0.0 green 0.0 blue 0.8 filter 0.5]
  1161.   [  1.0  color red 0.8 green 0.8 blue 0.8 filter 1.0]
  1162. } // color_map
  1163. @com.------------------------------
  1164. @mt2.crackle pattern
  1165. // texture pigment/normal pattern
  1166.    crackle 0.5 turbulence 0.5
  1167. @com.------------------------------
  1168. @mt2.crand finish
  1169. // texture finish attribute
  1170. // randomly speckle the surface
  1171.  // Note, this is truly random, and looks BAD in animations
  1172. crand 0.2
  1173. @com.------------------------------
  1174. @mt2.dents pattern
  1175. // texture pigment/normal pattern
  1176. dents 0.6 // dented surface (0...1) [0.0]
  1177. @com.------------------------------
  1178. @mt2.diffuse finish
  1179. // texture finish attribute
  1180. diffuse 0.6 // amount of diffuse lighting (0...1) [0.6]
  1181. @com.------------------------------
  1182. @mt2.finish component
  1183. // texture statement (an object's surface/internal properties)
  1184. finish { ambient 0.2 specular 0.5 reflection 0.2 }
  1185. @com.------------------------------
  1186. @mt2.frequency attribute
  1187. // texture pigment/normal attribute
  1188. frequency 2.0 // oscillation freq. of radial, ripples, waves, etc
  1189. @com.------------------------------
  1190. @mt2.gradient pattern
  1191. // texture pigment/normal pattern
  1192. gradient y // specify color_map direction(s)
  1193. // color_map {...} // requires a color map
  1194. @com.------------------------------
  1195. @mt2.granite pattern
  1196. // texture pigment/normal pattern
  1197. granite // create a granite-like texture
  1198. // color_map {...} // optional color map
  1199. @com.------------------------------
  1200. @mt2.hexagon pattern
  1201. // texture pigment/normal pattern
  1202. // create a hexagonal pattern texture with 3 colors
  1203. // hexagons are in the X-Z plane, extending infinitely in Y plane
  1204. hexagon
  1205.   color blue 1
  1206.   color red 1
  1207.   color green 1
  1208. @com.------------------------------
  1209. @mt2.irid finish
  1210. // texture finish attribute
  1211.   irid
  1212.   {
  1213.     0.4            // amount of iridescence saturation (0...1) [0]
  1214.     thickness 0.2
  1215.     turbulence 0.7
  1216.   }
  1217. @com.------------------------------
  1218. @mt2.ior finish
  1219. // texture finish attribute
  1220. // 1.0=air, 1.33=water, 1.5=glass, 2.4=diamond (see also IOR.INC)
  1221. ior 1.3 // index of refraction
  1222. @com.------------------------------
  1223. @mt2.lambda attribute
  1224. // texture pigment/normal attribute
  1225. // change surface perturbation property
  1226. // makes turbulence more "swirly"
  1227. lambda 1.2 // (1.0...5.0) [2.0]
  1228. @com.------------------------------
  1229. @mt2.leopard pattern
  1230. // texture pigment/normal pattern
  1231. leopard // create a leopard spotted texture
  1232. // color_map {...} // optional color map
  1233. @com.------------------------------
  1234. @mt2.mandel pattern
  1235. // texture pigment/normal pattern
  1236. // create a mandelbrot fractal surface in the X-Y plane
  1237. mandel 50 // (2...1000) [256]
  1238. // scale <...> translate <...> // zoom and move
  1239. // color_map {...} // requires a color map
  1240. @com.------------------------------
  1241. @mt2.marble pattern
  1242. // texture pigment/normal pattern
  1243. marble // create a marble-like texture
  1244. // turbulence 1.0 // should have some!
  1245. // color_map {...} // uses a color map
  1246. @com.------------------------------
  1247. @mt2.metallic finish
  1248. // texture finish attribute
  1249. // use surface color, not light source color for phong hilights
  1250. metallic on // on/off
  1251. @com.
  1252. @com.============================================================
  1253. @mt1.Textures N-Z
  1254. @com.============================================================
  1255. @com.
  1256. @com.------------------------------
  1257. @mt2.normal component
  1258. // texture component
  1259. // defines an object's surface bumpiness
  1260.   normal { wrinkles 0.5 scale 0.5 }
  1261. @com.------------------------------
  1262. @mt2.octaves attribute
  1263. // texture pigment/normal attribute
  1264. // increases the "folds" in turbulence changes
  1265. octaves 3 // (1...10) [6]
  1266. @com.------------------------------
  1267. @mt2.omega attribute
  1268. // texture pigment/normal attribute
  1269. // change surface perturbation property
  1270. // makes turbulence more "krinkly"
  1271. omega 1.2 // (0.0...2.0) [0.5]
  1272. @com.------------------------------
  1273. @mt2.onion pattern
  1274. // texture pigment/normal pattern
  1275. onion // create an onion-like concentric circle texture
  1276. // color_map {...} // requires a color map
  1277. @com.------------------------------
  1278. @mt2.pigment component
  1279. // texture component (an object's surface color)
  1280.   pigment { color rgb <0.7,0.5,0.3> }
  1281. @com.------------------------------
  1282. @mt2.phase attribute
  1283. // texture pigment/normal attribute
  1284. // change the phase of ripples, etc.
  1285. // Animation note:  As phase DECREASES, ripples move OUTWARD.
  1286. phase 0.5
  1287. @com.------------------------------
  1288. @mt2.phong finish
  1289. // texture finish attribute
  1290. // add phong hilighting to surface (0...1)
  1291.  phong 0.8
  1292. @com.------------------------------
  1293. @mt2.phong_size finish
  1294. // texture finish attribute
  1295. // set the size of the phong spot (1...250) [40]
  1296. // 20=dull rubber, 40=plastic, 200=shiny glass
  1297. phong_size 80
  1298. @com.------------------------------
  1299. @mt2.quick_color attribute
  1300. // texture pigment attribute
  1301. quick_color green 1 // low-quality quick-render color
  1302. @com.------------------------------
  1303. @mt2.quilted pattern
  1304. // texture pigment/normal pattern
  1305. // creates a pattern like a quilt
  1306. quilted 0.4 // amount
  1307. control0 -1 // lower curvature (-1...1)
  1308. control1 1 // upper curvature (-1...1)
  1309. @com.------------------------------
  1310. @mt2.radial pattern
  1311. // texture pigment/normal pattern
  1312. // radially projected color_map in X-Z
  1313. radial
  1314. // frequency 4.0 // increases # of color "spokes"
  1315. // color_map ...
  1316. @com.------------------------------
  1317. @mt2.reflection finish
  1318. // texture finish attribute
  1319. reflection 0.3 // amount of surface reflection (0...1) [0]
  1320. @com.------------------------------
  1321. @mt2.ripples pattern
  1322. // texture pigment/normal pattern
  1323. ripples 0.5 // make surface ripply (0...1)
  1324. @com.------------------------------
  1325. @mt2.roughness finish
  1326. // texture finish attribute
  1327. // alters specular hilighting
  1328. roughness 0.01 // 1.0=rough, 0.001=smooth [0.05]
  1329. @com.------------------------------
  1330. @mt2.specular finish
  1331. // texture finish attribute
  1332. // Note: size of hilight depends on roughness attribute
  1333. specular 0.7 // use specular hilighting on surface (0...1) [0]
  1334. @com.------------------------------
  1335. @mt2.spiral1 pattern
  1336. // texture pigment/normal pattern
  1337.   spiral1 5
  1338. @com.------------------------------
  1339. @mt2.spiral2 pattern
  1340. // texture pigment/normal pattern
  1341.   spiral2 5, 0.6
  1342. @com.------------------------------
  1343. @mt2.spotted pattern
  1344. // texture pigment/normal pattern
  1345.   spotted // create a spotted texture, turbulence has no effect
  1346. // color_map {...} // requires a color map
  1347. @com.------------------------------
  1348. @mt2.turbulence attribute
  1349. // texture pigment/normal attribute
  1350. // Takes a float or vector, see also octaves, omega, lambda, frequency
  1351. turbulence <0, 1, 0.5> // how much to “stir up” the texture (0...1 or more)
  1352. @com.------------------------------
  1353. @mt2.warp attribute
  1354. // texture pigment modifier
  1355. warp { turbulence 0.4*x octaves 2 repeat x*2  flip y  offset z*0.25 }
  1356. @com.------------------------------
  1357. @mt2.waves pattern
  1358. // texture pigment/normal pattern
  1359. // create a wavy surface (also use phase)
  1360. waves 0.5
  1361. @com.------------------------------
  1362. @mt2.wood pattern
  1363. // texture pigment/normal pattern
  1364. // create a concentric cylindrical wood-like texture,
  1365. // grain along Z axis
  1366. wood
  1367. // turbulence 0.1 // should have some!
  1368. // color_map {...} // optional color map
  1369. @com.------------------------------
  1370. @mt2.wrinkles pattern
  1371. // texture pigment/normal pattern
  1372. // create a wrinkly surface (0...1 or more)
  1373. wrinkles 0.5
  1374. @com.------------------------------
  1375. @com.
  1376. @com.============================================================
  1377. @mt1.Texture Colors
  1378. @com.============================================================
  1379. @com.
  1380. @com.------------------------------
  1381. @mt2.blue
  1382. color blue 1
  1383. @com.------------------------------
  1384. @mt2.filter
  1385. color red 1 filter 1
  1386. @com.------------------------------
  1387. @mt2.green
  1388. color green 1
  1389. @com.------------------------------
  1390. @mt2.red
  1391. color red 1
  1392. @com.------------------------------
  1393. @mt2.transmit
  1394. color green 1 transmit 1
  1395. @com.------------------------------
  1396. @mt2.rgb
  1397. // rgb - Red Green Blue color shortcut
  1398. color rgb <0.2, 0.3, 0.4>
  1399. @com.------------------------------
  1400. @mt2.rgbf
  1401. // rgbf - Red Green Blue Filter color shortcut
  1402. color rgbf <0.2, 0.3, 0.4, 0.9>
  1403. @com.------------------------------
  1404. @mt2.rgbft
  1405. // rgbft - Red Green Blue Filter Transmit color shortcut
  1406. // NOTE: filter + transmit should always equal 1.0
  1407. color rgbft <0.5, 0.5, 0.5, 0.4, 0.6>
  1408. @com.------------------------------
  1409. @mt2.rgbt
  1410. // rgbt - Red Green Blue Transmit color shortcut
  1411. color rgbt <0.2, 0.3, 0.4, 0.9>
  1412. @com.------------------------------
  1413. @mt2.color components
  1414. // extract each component of a color:
  1415. // #if (MyColor.red < 0.5) ...
  1416. // #if (MyColor.green < 0.5) ...
  1417. // #if (MyColor.blue < 0.5) ...
  1418. // #if (MyColor.filter < 0.5) ...
  1419. // #if (MyColor.transmit < 0.5) ...
  1420. @com.
  1421. @com.============================================================
  1422. @mt1.Texture Maps
  1423. @com.============================================================
  1424. @com.
  1425. @com.------------------------------
  1426. @mt2.bump_map normal
  1427. // texture normal {} attribute
  1428. // create a texture that has a bumpiness corresponding to color index
  1429. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1430. bump_map
  1431. { // uses image color or index as bumpiness
  1432.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1433.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1434.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1435.   // [use_color | use_index]
  1436.   // [once]
  1437.   bump_size 0.5 // 0...3
  1438. } // bump_map
  1439. @com.------------------------------
  1440. @mt2.image_map pigment
  1441. // texture pigment {} attribute
  1442. // create a texture that lays an image's colors onto a surface
  1443. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1444. image_map
  1445. {
  1446.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1447.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1448.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1449.   // [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1450.   // [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1451.   // [use_color | use_index]
  1452.   // [once]
  1453. } // image_map
  1454. @com.------------------------------
  1455. @mt2.material_map texture
  1456. // texture attribute
  1457. // create a texture that maps different textures onto different color indexes
  1458. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1459. material_map
  1460. {
  1461.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1462.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1463.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1464.   // [once]
  1465.   texture { pigment {wood} }  // texture for color index # 0
  1466.   texture { pigment {granite} }  // texture for color index # 1
  1467.   texture { pigment {agate} }  // texture for color index # 2
  1468.   // etc...
  1469. } // material_map
  1470. @com.------------------------------
  1471. @mt2.tiles texture
  1472. // texture component
  1473. // create a tiled texture, alternates between 2 full textures
  1474. tiles
  1475. {
  1476.   texture    // full texture of tile #1
  1477.   {
  1478.     pigment { agate scale 0.3 }
  1479.     finish { ambient 0.2 }
  1480.   }
  1481.   tile2
  1482.   texture    // full texture of tile #2
  1483.   {
  1484.     pigment { granite }
  1485.     finish { specular 0.3 reflection 0.2 }
  1486.   }
  1487. }
  1488. @com.
  1489. @com.============================================================
  1490. @mt1.Std colors
  1491. @com.============================================================
  1492. @com.
  1493. @mt2."Colors.inc"
  1494. // Standard pre-defined colors
  1495. #include "colors.inc"
  1496. @com.
  1497. @com.============================================================
  1498. @mt1.Ready-Made Scenes
  1499. @com.============================================================
  1500. @com.
  1501. @com.------------------------------
  1502. @mt2.Basic scene
  1503. // Persistence of Vision Ray Tracer Scene Description File
  1504. // File: ?.pov
  1505. // Vers: 3.1
  1506. // Desc: Basic Scene Example
  1507. // Date: mm/dd/yy
  1508. // Auth: ?[esp]
  1509. //
  1510.  
  1511. #version 3.1;
  1512.  
  1513. #include "colors.inc"
  1514.  
  1515. global_settings
  1516. {
  1517.   assumed_gamma 1.0
  1518. }
  1519.  
  1520. // ----------------------------------------
  1521. camera
  1522. {
  1523.   location  <0.0, 0.5, -4.0>
  1524.   direction 1.5*z
  1525.   right     4/3*x
  1526.   look_at   <0.0, 0.0,  0.0>
  1527. }
  1528.  
  1529. sky_sphere
  1530. {
  1531.   pigment
  1532.   {
  1533.     gradient y
  1534.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1535.   }
  1536. }
  1537.  
  1538. light_source
  1539. {
  1540.   0*x // light's position (translated below)
  1541.   color red 1.0  green 1.0  blue 1.0  // light's color
  1542.   translate <-30, 30, -30>
  1543. }
  1544.  
  1545. // ----------------------------------------
  1546. plane { y, -1 pigment {color rgb <0.7,0.5,0.3>}}
  1547.  
  1548. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1549.  
  1550. @com.------------------------------
  1551. @mt2.Checkered floor
  1552. // Persistence of Vision Ray Tracer Scene Description File
  1553. // File: ?.pov
  1554. // Vers: 3.1
  1555. // Desc: Checkered Floor Example
  1556. // Date: mm/dd/yy
  1557. // Auth: ?
  1558. //
  1559.  
  1560. #version 3.1;
  1561.  
  1562. #include "colors.inc"
  1563.  
  1564. global_settings
  1565. {
  1566.   assumed_gamma 1.0
  1567. }
  1568.  
  1569. // ----------------------------------------
  1570. camera
  1571. {
  1572.   location  <0.0, 0.5, -4.0>
  1573.   direction 1.5*z
  1574.   right     4/3*x
  1575.   look_at   <0.0, 0.0,  0.0>
  1576. }
  1577.  
  1578. sky_sphere
  1579. {
  1580.   pigment
  1581.   {
  1582.     gradient y
  1583.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1584.   }
  1585. }
  1586.  
  1587. light_source
  1588. {
  1589.   0*x // light's position (translated below)
  1590.   color red 1.0  green 1.0  blue 1.0  // light's color
  1591.   translate <-30, 30, -30>
  1592. }
  1593.  
  1594. // ----------------------------------------
  1595. plane
  1596. {
  1597.   y, -1
  1598.   texture
  1599.   {
  1600.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1601.     finish {reflection 0.2}
  1602.   }
  1603. }
  1604.  
  1605. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1606.  
  1607. @com.------------------------------
  1608. @mt2.Text Fonts
  1609. // Persistence of Vision Ray Tracer Scene Description File
  1610. // File: ?.pov
  1611. // Vers: 3.1
  1612. // Desc: Basic TTF font Example
  1613. // Date: mm/dd/yy
  1614. // Auth: ?
  1615. //
  1616.  
  1617. #version 3.1;
  1618.  
  1619. global_settings
  1620. {
  1621.   assumed_gamma 1.0
  1622. }
  1623.  
  1624. // ----------------------------------------
  1625. camera
  1626. {
  1627.   location  <0.0, 2.0, -6.0>
  1628.   direction 1.5*z
  1629.   right     4/3*x
  1630.   look_at   <0.0, 0.0,  0.0>
  1631. }
  1632.  
  1633. sky_sphere
  1634. {
  1635.   pigment
  1636.   {
  1637.     gradient y
  1638.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1639.   }
  1640. }
  1641.  
  1642. light_source
  1643. {
  1644.   0*x // light's position (translated below)
  1645.   color red 1.0  green 1.0  blue 1.0  // light's color
  1646.   translate <-20, 10, -30>
  1647. }
  1648.  
  1649. // ----------------------------------------
  1650.  
  1651. #declare Text_Tex = texture
  1652. {
  1653.   pigment { granite scale 0.5 }
  1654.   finish { specular 0.7 }
  1655. }
  1656.  
  1657. text
  1658. {
  1659.   ttf "crystal.ttf", "Hello",
  1660.   2, // depth
  1661.   0  // spacing
  1662.   texture {Text_Tex}
  1663.   rotate <0, -20, 0>
  1664.   translate <-1, 0, -3>
  1665. }
  1666.  
  1667. text
  1668. {
  1669.   ttf "crystal.ttf", "Virtual World!",
  1670.   1, // depth
  1671.   0  // spacing
  1672.   scale <1, 2, 1> // stretch it taller
  1673.   texture {Text_Tex}
  1674.   rotate <0, -30, 0>
  1675.   translate <-3, 0, 3>
  1676. }
  1677.  
  1678.  
  1679. plane { y, 0 pigment {color rgb <0.7,0.5,0.3>} }
  1680.  
  1681. @com.------------------------------
  1682. @mt2.Image Map
  1683. // Persistence of Vision Ray Tracer Scene Description File
  1684. // File: ?.pov
  1685. // Vers: 3.1
  1686. // Desc: Image Map Example
  1687. // Date: mm/dd/yy
  1688. // Auth: ?
  1689. //
  1690.  
  1691. #version 3.1;
  1692.  
  1693. #include "colors.inc"
  1694.  
  1695. global_settings
  1696. {
  1697.   assumed_gamma 1.0
  1698. }
  1699.  
  1700. // ----------------------------------------
  1701. camera
  1702. {
  1703.   location  <0.0, 0.0, -4.0>
  1704.   direction 2*z
  1705.   right     4/3*x
  1706.   look_at   <0.0, 0.0,  0.0>
  1707. }
  1708.  
  1709. sky_sphere
  1710. {
  1711.   pigment
  1712.   {
  1713.     gradient y
  1714.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1715.   }
  1716. }
  1717.  
  1718. light_source
  1719. {
  1720.   0*x // light's position (translated below)
  1721.   color red 1.0  green 1.0  blue 1.0  // light's color
  1722.   translate <-30, 30, -30>
  1723. }
  1724.  
  1725. // ----------------------------------------
  1726. plane
  1727. {
  1728.   y, -1
  1729.   texture
  1730.   {
  1731.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1732.     finish {reflection 0.2}
  1733.   }
  1734. }
  1735.  
  1736. plane
  1737. {
  1738.   z, -1
  1739.   texture
  1740.   {
  1741.     pigment
  1742.     {
  1743.       image_map
  1744.       {
  1745.         png "test.png"
  1746.         interpolate 2 // smooth it
  1747.         once   // don't tile image, just one copy
  1748.         filter 0 0.8  // make 1st color mostly transparent
  1749.         filter 1 0.8  // make 2nd color mostly transparent
  1750.       }
  1751.       // transform it to unit-size (-1 to +1)
  1752.       translate -0.5*(x+y) // center on the origin
  1753.       scale 2              // make it unit-sized
  1754.     }
  1755.     finish {ambient 0.3}
  1756.   }
  1757. }
  1758. @com.============================================================
  1759. @com.end of file is next
  1760. @@@@
  1761.